#define lv PORTB.RB0
#define lj PORTB.RB1
#define lbe PORTB.RB2
#define lbc PORTB.RB3
#define lr PORTB.RB4

char text[] = "uart donnee";
char chiffre[2] ;
char i;
char j=0;

void main() {
  PORTB=0x00;
  TRISB=0x00;


  UART1_Init(9600);               // Initialize UART module at 9600 bps
  Delay_ms(100);                  // Wait for UART module to stabilize

  lv=1;
  //UART1_Write(j);
  //UART1_Write_Text(text);
  //UART1_Write_Text("STOP");
  //UART1_Write(48);
  //UART1_Write(13);
  Delay_ms(1000);
  lv=0;

  while (1) {                     // Endless loop
    lj=1;
    //UART1_Write(65);
    //UART1_Write_Text("test STOP");
    delay_ms(1000);
    lj=0;

    lbe=1;
    for(i=0;i<100;i++){
      lbc=1;
      chiffre[1]=(i%10)+48;
      chiffre[0]=((int)(i/10))+48;
      //UART1_Write_Text(chiffre);
      //UART1_Write_Text("STOP");
      UART1_Write(chiffre[0]);
      //UART1_Write(' ');
      UART1_Write(chiffre[1]);
      UART1_Write(' ');
      lbc=0;
      lr=1;
      Delay_ms(1000);
      lr=0;

    }
    lbe=0;
  }
}